package cn.stylefeng.guns.modular.car.controller;

import cn.hutool.core.lang.tree.Tree;
import cn.stylefeng.guns.modular.car.entity.Car;
import cn.stylefeng.guns.modular.car.pojo.request.CarRequest;
import cn.stylefeng.guns.modular.car.service.BrandService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * ┌─┐       ┌─┐ + +
 * ┌──┘ ┴───────┘ ┴──┐++
 * │                 │
 * │       ───       │++ + + +
 * ███████───███████ │+
 * │                 │+
 * │       ─┴─       │
 * │                 │
 * └───┐         ┌───┘
 * │         │
 * │         │   + +
 * │         │
 * │         └──────────────┐
 * │                        │
 * │                        ├─┐
 * │                        ┌─┘
 * │                        │
 * └─┐  ┐  ┌───────┬──┐  ┌──┘  + + + +
 * │ ─┤ ─┤       │ ─┤ ─┤
 * └──┴──┘       └──┴──┘  + + + +
 * 神兽保佑
 * 代码无BUG!
 */
@RestController
@ApiResource(name = "品牌管理")
public class BrandController {
    @Resource
    private BrandService brandService;


    /**
     * 获取列表
     *
     * @author xbz
     * @date 2023/04/07 14:21
     */
    @GetResource(name = "获取列表", path = "/brand/list",requiredPermission = false,requiredLogin = false)
    public ResponseData< List<Tree<Integer>>> list() {
        return new SuccessResponseData<>(brandService.selectAll());
    }
}
